#!/bin/sh

if [ $UID -eq 0 ]; then
    echo '用root账户使用此脚本是十分危险的行为！操作取消'
    exit 1
fi

if [ -f $HOME/.config/plasma-workspace/env/kde-i3.sh ]; then
    rm $HOME/.config/plasma-workspace/env/kde-i3.sh 
fi

read -p '是否删除i3配置文件？<y/n>' cfm

case "$cfm" in
Y|y)
    rm -rf $HOME/.config/i3 ;;
*)
    echo '依赖和配置文件已保留'
esac

read -p '是否删除安装依赖？<y/n>' cfm

case "$cfm" in
Y|y)
    sudo pacman -Rs picom i3-gaps feh i3status wmctrl
    rm -rf $HOME/.config/i3 ;;
*)
    echo '依赖已保留'
esac